package com.haiheng.common.api

import com.haiheng.library_base.utils.SPUtils

import com.haiheng.common.constant.AppConstant

/**
 *
 * @Des:
 * @Author: hwz
 * @Date:2022/5/6 0006
 * @Version: 1.0
 */
class API {

    companion object {
        //通用地址
        const val BASE_URL = "http://172.16.0.118:9000"
        const val ACS_URL = "http://172.16.0.118:15606"
        const val FACE_URL = "http://172.16.0.230:15109"
        const val ISBN_URL = "https://yidu.seaeverit.com"
        const val SP_BASE_URL = "SP_BASE_URL"
        const val SP_ACS_URL = "SP_ACS_URL"
        const val SP_FACE_URL = "SP_FACE_URL"
        //借还通用接口名
        const val POST_PATH = "v1/cdc/acs/api"
//        const val POST_PATH_HAIHENG = "/librarycode/CN-518000-HHZT/v1/cdc/acs/api"
        fun getBaseUrl(): String {
            var baseUrl = SPUtils.getInstance().getString(SP_BASE_URL, BASE_URL)
            return baseUrl
        }

        fun getAcsUrl():String{
            var acsUrl = SPUtils.getInstance().getString(SP_ACS_URL, ACS_URL)
            return acsUrl
        }

        fun getFaceUrl():String{
            var faceUrl = SPUtils.getInstance().getString(SP_FACE_URL, FACE_URL)
            return faceUrl
        }

        fun getIsbnUrl():String{
            return ISBN_URL
        }
    }

    interface PARAM{
      companion object{
          const val CLIENT_SECRET = "devUnion123!"
          const val GRANT_TYPE = "client_credentials"
          const val CLIENT_ID = "devUnion"
          const val PARAM_HEADER_TOKEN = "Authorization"
          const val PARAGM_REQUEST_OBJECT = "edc.mach"
          const val PARAGM_ACS_REQUEST_OBJECT = "cdc.acs"
          const val PARAGM_REQUEST_OBJECT_FACE = "tunano.ldc.face"
          const val PARAGN_MODE_TYPE = "VWR-S1"//智慧屏 数字人 LDP-S01
          const val PARAGE_CATALOG_TYPE = 7//智慧屏 数字人 14

      }
    }

    interface OPERATION {
        companion object {
            const val ADDMACHINE = "AddMachine"//添加设备
            const val ADDSTATUS = "AddStatus"//上报

            const val  QUERYPATRONINFOBYIDENTITYID = "QueryPatronInfoByIdentityId"//以身份证号查询读者
            const val  QUERYPATRONINFOBYPATRONSN = "QueryPatronInfoByPatronSn"//以读者证号查询读者
            const val  QUERYBOOKINFO = "QueryBookInfo"//询图书
            const val  LENDBOOK = "MachineLendBook"//借书
            const val  RETURNBOOK = "MachineReturnBook"//还书
            const val  RENEWBOOK = "MachineRenewBook"//续借
            const val  PULLINCNPACKAGE = "pullIncrPackage"//人脸同步
            const val QUERYBYISBN = "/v1/o2o/book/info/{isbn}"//查询isbn


        }
    }

    interface PATH {
        companion object {
            //token请求接口
            const val CONNECT_TOKEN = "/tunano/passport/connect/token"
            const val EDC_MACH = "/tunano/edc/mach/v1/edc/mach"
            const val EDC_MACH_STATUS = "/tunano/edc/mach/v1/edc/mach/status"
            const val GET_FACE_TOKEN_PATH = "/v1/ldc/face/FaceSecurity/login"//人脸token
            const val SYNCHRONIZE_FACE_RES_PATH = "/v1/ldc/face/Synchronization/resource" //同步人脸数据


            //清点图书
            const val BOOK_LIST = "/book/list"

            //修改防盗位-借书用 值 0：失败，1：成功，-1：指定UID图书不存在
            const val BOOK_BORROW = "/book/borrow"

            //修改防盗位-还书用 值 0：失败，1：成功，-1：指定UID图书不存在
            const val BOOK_RETURN = "/book/return"
        }
    }


}

